#include "tperson.h"

#include <QDebug>

TPerson::TPerson(QString name, QObject *parent)
    : m_name{name}, QObject{parent}
{

}

TPerson::~TPerson()
{
    qDebug() << "TPerson object is deleted";
}

int TPerson::age()
{
    return m_age;
}

void TPerson::setAge(quint8 ageValue)
{
    if (m_age != ageValue) {
        m_age = ageValue;
        emit ageChanged(m_age);
    }
}

void TPerson::incAge()
{
    m_age++;
    emit ageChanged(m_age);
}
